﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XYX.Http.Mvc
{
    /// <summary>
    /// Http处理Url后面的参数
    /// </summary>
    public class UrlParameterHandler
    {

        /// <summary>
        /// 处理参数类型
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>

        public static Type GetUrlParameterType(object value)
        {
            if (value != null)
            {
                string tempValue = value.ToString();
                bool flag = int.TryParse(tempValue, out _);
                if (flag)
                {
                    return typeof(int);
                }

                flag = DateTime.TryParse(tempValue, out _);
                if (flag)
                {
                    return typeof(DateTime);
                }
            }
            return typeof(string);
        }
    }

   
}
